<?php

class CompleteLists extends Controller {
	function CompleteLists()
	{
		parent::Controller();
	}

	function index()
	{
	 	if ($this->session->userdata('logged_in') != TRUE)
	    {
	        redirect('login/index');
	    }
	    $this->load->model('StudentModel');
	    $this->load->library('pagination');

	    $per_page = 15;
   		$total = $this->StudentModel->countForCompleteList();
   		
   
   		$base_url = site_url('CompleteLists/index/');
	    $config['base_url'] = $base_url;
	    $config['total_rows'] = $total;
	    $config['per_page'] = $per_page;
	    $config['uri_segment'] = '3';
	    $this->pagination->initialize($config); 
		$data['paging'] = str_replace('index.html/', 'index/', $this->pagination->create_links());
		$data['selected_stu'] = $this->StudentModel->selectForCompleteList($per_page, $this->uri->segment(3));
		
		$this->load->view('header');
		$this->load->view('complete-list-form', $data);
		$this->load->view('footer');
	}	
}
?>
